home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
tutor
/
pro30
/
whilelp.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-02-04
|
919b
|
31 lines
(* Chapter 4 - Program 7 *)
program While_Loop_Example;
var Counter : integer;
begin
Counter := 4;
while Counter < 20 do begin
Write('In the while loop, waiting ');
Write('for the counter to reach 20. It is',Counter:4);
Writeln;
Counter := Counter + 2;
end;
end.
{ Result of execution
In the while loop, waiting for the counter to reach 20. It is 4
In the while loop, waiting for the counter to reach 20. It is 6
In the while loop, waiting for the counter to reach 20. It is 8
In the while loop, waiting for the counter to reach 20. It is 10
In the while loop, waiting for the counter to reach 20. It is 12
In the while loop, waiting for the counter to reach 20. It is 14
In the while loop, waiting for the counter to reach 20. It is 16
In the while loop, waiting for the counter to reach 20. It is 18
}